{% extends 'basic.html' %}
{% block title %}添加模块{% endblock %}
{% block content %}
    <div class="row h4">
        <form action="{% url 'add_modules' %}" method="post" class="form-inline">
            {% csrf_token %}
            <div class="form-group">
                模块: <input class="form-control" type="text" name="module">
            </div>
            <div class="form-group">
                参数: <input class="form-control" type="text" name="param">
            </div>
            <div class="form-group">
                <input class="btn btn-primary" type="submit" value="提 交">
            </div>
        </form>
        <hr>
        <table class="table table-bordered table-striped table-hover">
            <thead class="bg-primary">
                <tr>
                    <td>模块</td>
                    <td>参数</td>
                </tr>
            </thead>
            <tbody>
                {% for module in modules %}
                    <tr>
                        <td>{{ module.modulename }}</td>
                        <td>
                            {% for arg in module.argument_set.all %}
                                <div>
                                    <div class="col-sm-7">
                                        {{ arg.arg_text }}
                                    </div>
                                    <div class="col-sm-5">
                                        <a class="btn btn-danger btn-xs" href="{% url 'del_arg' arg.id %}">
                                            delete
                                        </a>
                                    </div>
                                </div>
                            {% endfor %}
                        </td>
                    </tr>
                {% endfor %}
            </tbody>
        </table>
    </div>
{% endblock %}